package com.example.draw

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import androidx.navigation.NavController
import androidx.navigation.findNavController
import androidx.navigation.ui.AppBarConfiguration
import androidx.navigation.ui.NavigationUI
import androidx.navigation.ui.setupActionBarWithNavController
import androidx.navigation.ui.setupWithNavController
import kotlinx.android.synthetic.main.activity_main.*

class MainActivity : AppCompatActivity() {
    private lateinit var appBarConfiguration:AppBarConfiguration
    private lateinit var navController:NavController

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        navController =findNavController(R.id.fragment)
//        appBarConfiguration = AppBarConfiguration(navController.graph,drawerLayout = null)
//        setupActionBarWithNavController(navController,appBarConfiguration)
//        navigationView.setupWithNavController(navController)
//        appBarConfiguration = AppBarConfiguration.Builder(navController.graph)
//            .setOpenableLayout(drawLayout)
//            .build()
//        NavigationUI.setupActionBarWithNavController(this,
//            navController,appBarConfiguration)
//        NavigationUI.setupWithNavController(navigationView,navController)

        appBarConfiguration = AppBarConfiguration.Builder(navController.graph)
            .setOpenableLayout(drawLayout)
            .build()
        NavigationUI.setupActionBarWithNavController(this, navController, appBarConfiguration);


    }


}